package com.sali.rule;


import com.sali.utils.SnowflakeIdWorkerUtil;


public class SnowflakeIdRule implements Rule {
    private SnowflakeIdWorkerUtil idWorker = SnowflakeIdWorkerUtil.getInstance();
    private static Rule rule;

    static {
        rule = new SnowflakeIdRule();
    }

    @Override
    public Object invoke(Object value) {
        return String.valueOf(idWorker.nextId());
    }

    /**
     * 获取实例方法
     *
     * @return
     */
    public static Rule getInstance() {
        return rule;
    }
}
